<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>面向对象-继承</title>
</head>

<script>


    function Dog(name) {
        this.name = name;
        this.sing = function(){
            alert("wangwang");
        };
    }

    function pitter(){
        this.fire = function(){
            alert("第一斗犬")
        }
    }

//    原型继承
    pitter.prototype = new Dog();

    var huzi = new pitter();


    huzi.sing();

    function zangao(){
        this.eat = function(){
            alert('会吃会吹')
        }
    }


    zangao.prototype = new Dog();

    zangao.prototype.bark = function(){
        alert("wuwuwu")
    }


</script>
<body>

</body>
</html>

